package pt.iscte.pcd.ballmovers;
import java.awt.Color;


public class Ball {

	public static final int SIZE = 10;
	private int x = 0;
	private int y = 0;
	private Color color;

	public Ball(int y, Color color) {
		this.y = y;
		this.color = color;
		System.out.println("Ball created @ " + y);
	}
	
	public synchronized void push() {
		x++;
	}
	
	public synchronized int getX() {
		return x;
	}

	public Color getColor() {
		return color;
	}
	public boolean atEnd() {
		return x == BallMoversApp.END_OF_TRACK;
	}

	public int getY() {
		return y;
	}

	public String toString() {
		return "(" + x + "," + y + ")"; 
	}
}
